<?php
/**
 * Created by PhpStorm.
 * User: 13469
 * Date: 2018/10/8
 * Time: 19:26
 */
include "config.php";
$pid=isset($_REQUEST["pid"])?$_REQUEST["pid"]:"";
if($pid!=""){
    $datastr=file_get_contents("data/data.json");
    $dataArr=json_decode($datastr);
    for ($i=0;$i<count($dataArr);$i++){
        if($dataArr[$i]->c_id==$pid){
            print_r(json_encode($dataArr[$i]));
            return ;
        }
    }
    print_r("[]");
}else{
    print_r(file_get_contents("data/data.json"));
}
//print_r(file_get_contents("data/data.json"));